<template>
  <view class="index">
    <view class="jtop">
      <view class="status_bar"><!-- 这里是状态栏 --></view>
      <view class="jtop_l" @tap="navigateBack"
        ><image src="../../static/img/ic_back.png"></image
      ></view>
      <view class="jtop_c">空间信息</view>
    </view>

    <view class="tophr"></view>

    <view class="addi" @tap="to_name">
      <text>空间名称</text>
      <input
        type="text"
        placeholder="天府广场项目"
        placeholder-style="color:#999999"
        disabled="true"
      />
    </view>

    <view class="addb">
      <view class="addbi noborder" @tap="to_user">
        <text class="addbil">空间成员及权限</text>
        <image src="../../static/img/jt.png"></image>
        <text class="addbir">10</text>
      </view>
      <view class="ptaf ">
        <view class="ptac">
          <view class="jhead_portrait">
            <image src="../../static/img/jhead_portrait.png" class="txl"></image>
            <view class="txct">
              唐飞
            </view>
          </view>
          <view class="jhead_portrait">
            <image src="../../static/img/jhead_portrait.png" class="txl"></image>
            <view class="txct">
              唐飞
            </view>
          </view>
          <view class="jhead_portrait">
            <image src="../../static/img/jhead_portrait.png" class="txl"></image>
            <view class="txct">
              唐飞
            </view>
          </view>
        </view>
      </view>
      <view class="dg_add" @tap="to_user_select">
        <image src="../../static/img/doc/ic_add_1.png"></image>
        <text>添加成员</text>
      </view>
    </view>

    <view class="dg_e" @tap="tc">
      退出空间
    </view>
  </view>
</template>

<script>
import request from '@/common/request.js';

import biaofunDatetimePicker from '@/components/biaofun-datetime-picker/biaofun-datetime-picker.vue';

import { mapState } from 'vuex';

export default {
  components: {
    biaofunDatetimePicker,
  },

  computed: mapState(['forcedLogin', 'hasLogin', 'userName']),
  /**
   * 页面数据
   */
  data() {
    return {
      repeat_click: true,
      defaultValue: '2020-06-08 10:30', // 默认值
    };
  },

  methods: {
    tc() {
      var jd = {
        workGroupId: uni.getStorageSync('temp_data2').id,
      };

      request({
        url: `/modor/v1/project/${
          uni.getStorageSync('dqfull_name').id
        }/work/group/payment`,
        data: jd,

        method: 'POST',
        success: openIdRes => {
          console.log(openIdRes);
          if (openIdRes.data.success == true) {
            wx.showToast({
              title: '退出成功',
              icon: 'none',
              duration: 1000,
              success: function() {
                setTimeout(function() {
                  uni.switchTab({
                    url: '/pages/doc/doc',
                  });
                }, 1500);
              },
            });
          } else {
            this.repeat_click = true;
            uni.showToast({
              title: openIdRes.data.msg,
              icon: 'none',
            });
            this.isLoading = false;
          }
        },
        fail: () => {
          this.repeat_click = true;
          uni.showToast({
            title: '服务器开小差，请稍后~',
            icon: 'none',
          });
          return false;
        },
      });
    },
    // 跳转
    to_name() {
      uni.navigateTo({
        url: '../doc/doc_gis_name',
      });
    },

    to_user() {
      uni.navigateTo({
        url: '../doc/doc_user',
      });
    },

    to_user_select() {
      uni.navigateTo({
        url: '../doc/doc_user_select',
      });
    },

    /**
     * 确认选择日期时间
     * @param {Object} date 日期数据
     */
    changeDatetimePicker(date) {
      console.log('选择的日期时间数据：', date);
    },
    navigateBack() {
      uni.navigateBack();
    },
  },
};
</script>

<style>
.tophr {
  width: 100%;
  height: 88rpx;
}
.addi {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  box-shadow: inset 0px 1px 0px #dddddd, inset 0px -1px 0px #dddddd;
  margin: 20rpx 0 0;
}
.addi text {
  width: auto;
  height: 90rpx;
  display: block;
  float: left;
  line-height: 90rpx;
  font-size: 34rpx;
  color: #000000;
  margin: 0 0 0 30rpx;
}
.addi input {
  width: auto;
  height: 50rpx;
  display: block;
  float: right;
  margin: 20rpx 30rpx 0 0;
  text-align: right;
  line-height: 50rpx;
  font-size: 34rpx;
  color: #999999;
}
.addb {
  width: 100%;
  height: auto;
  display: block;
  float: left;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-left: 0;
  border-right: 0;
  margin: 20rpx 0 0;
}
.addbi {
  width: 720rpx;
  margin: 0 0 0 30rpx;
  height: 90rpx;
  display: block;
  float: left;
  background: #ffffff;
  border-bottom: 1px solid #dddddd;
}
.addb .addbi:last-child {
  border: none;
}
.addbi .addbil {
  width: auto;
  height: 90rpx;
  display: block;
  float: left;
  line-height: 90rpx;
  font-size: 34rpx;
  color: #000000;
}
.addbi .addbir {
  width: auto;
  height: 90rpx;
  display: block;
  float: right;
  line-height: 90rpx;
  font-size: 32rpx;
  color: #999999;
}
.addbi image {
  width: 16rpx;
  height: 25rpx;
  display: block;
  float: right;
  margin: 33rpx 30rpx 0 30rpx;
}
.addi textarea {
  width: 690rpx;
  height: 150rpx;
  display: block;
  float: left;
  margin: 0rpx 30rpx 20rpx;
  text-align: left;
  line-height: 40rpx;
  font-size: 34rpx;
  color: #999999;
}

.addbi .addbir .datatime,
.addbi .addbir .datatime .uni-picker-container {
  min-width: 200rpx;
  height: 90rpx;
  display: block;
  float: right;
}
.ptaf {
  width: 720rpx;
  height: auto;
  display: block;
  float: right;
  border-bottom: 1px solid #dddddd;
}
.ptac {
  width: 650rpx;
  height: auto;
  display: block;
  float: left;
}
.jhead_portrait {
  width: 84rpx;
  height: auto;
  display: block;
  float: left;
  margin: 0rpx 20rpx 20rpx 0;
}
.txl {
  width: 84rpx;
  height: 84rpx;
  display: block;
  float: left;
  border-radius: 6rpx;
}
.pttjt {
  width: 16rpx;
  height: 25rpx;
  display: block;
  float: right;
  margin: 50rpx 30rpx 0 20rpx;
}
.txc {
  width: 400rpx;
  height: auto;
  display: block;
  float: left;
  margin: 0;
}
.txct {
  width: 84rpx;
  height: 32rpx;
  text-align: center;
  overflow: hidden;
  line-height: 32rpx;
  display: block;
  float: left;
  font-size: 24rpx;
  color: #999999;
  margin: 10rpx 0 0 0;
}

.dg_add {
  width: 720rpx;
  height: 90rpx;
  display: block;
  float: right;
}
.dg_add image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
  margin: 21rpx 10rpx 0rpx 0;
}
.dg_add text {
  width: auto;
  height: 42rpx;
  display: block;
  float: left;
  font-size: 34rpx;
  line-height: 42rpx;
  color: #000000;
  margin: 24rpx 0rpx 0rpx 0;
}
.dg_e {
  width: 100%;
  height: 90rpx;
  font-size: 36rpx;
  line-height: 90rpx;
  color: #eb5342;
  text-align: center;
  display: block;
  float: left;
  background: #ffffff;
  border: 1px solid #dddddd;
  border-left: 0;
  border-right: 0;
  margin: 20rpx 0 0;
}

.index {
  background: rgb(242, 242, 242);
  width: 100%;
  height: auto;
}
.jtop {
  width: 100%;
  height: 88rpx;
  background: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: inset 0px -1px 0px #dddddd;
}
.jtop_l {
  width: auto;
  height: 88rpx;
  display: block;
  float: left;
  font-size: 32rpx;
  color: #000000;
  line-height: 88rpx;
  margin: 0 0 0 30rpx;
}
.jtop_l image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
  margin: 20rpx 0 20rpx 0;
}
.jtop_r {
  width: auto;
  height: 88rpx;
  display: block;
  float: right;
  margin: 0rpx 20rpx 0 0;
  line-height: 88rpx;
  font-size: 32rpx;
  color: #000000;
  color: #256aff;
  opacity: 0.5;
}
.jtop_r image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: left;
}
.jtop_c {
  width: 70%;
  height: 48rpx;
  line-height: 48rpx;
  display: block;
  float: left;
  position: fixed;
  top: 20rpx;
  left: 15%;
  text-align: center;
  font-size: 36rpx;
  color: #000000;
}
.jtop_c image {
  width: 36rpx;
  height: 36rpx;
  display: inline-block;
  float: none;
  margin-bottom: -5rpx;
  margin-left: 5rpx;
}
.jtop_b {
  width: 100%;
  height: auto;
  background: #ffffff;
  position: fixed;
  top: 88rpx;
  left: 0;
  z-index: 1001;
}
.jtop_bj {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
}

.jtop_bs {
  width: 100%;
  height: auto;
  background: #ffffff;
  display: block;
  float: left;
}
.jtop_bs view {
  width: 720rpx;
  height: 90rpx;
  background: #ffffff;
  display: block;
  float: left;
  margin: 0 0 0 30rpx;
  border-bottom: 1px solid #dddddd;
}
.jtop_bs view text {
  width: 80%;
  height: 90rpx;
  line-height: 90rpx;
  background: #ffffff;
  display: block;
  float: left;
  font-size: 34rpx;
  color: #000000;
}
.jtop_bs view image {
  width: 48rpx;
  height: 48rpx;
  display: block;
  float: right;
  margin: 21rpx 30rpx 0 0;
}
.jtop_tc {
  display: none;
}
</style>
